/*
 * Copyright (c) 2023 OceanBase.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.oceanbase.tools.dbbrowser.model.datatype.parser;

import lombok.NonNull;

/**
 * {@link DataTypeTokenVisitor}
 *
 * @author yh263208
 * @date 2022-06-27 10:43
 * @since ODC_release_3.4.0
 */
public interface DataTypeTokenVisitor {
    /**
     * method will be called when name toke is detected
     *
     * @param token name token
     */
    void visitName(@NonNull DataTypeToken token);

    /**
     * left or right brackets is detedted
     *
     * @param token {@code (} or {@code )}
     */
    void visitBrackets(@NonNull DataTypeToken token);

    /**
     * integer value is detected, eg. scale or precision
     *
     * @param token number value
     */
    void visitNumber(@NonNull DataTypeToken token);

    /**
     * method will be called when known token detected
     *
     * @param token unknonw token
     */
    void visitUnknown(@NonNull DataTypeToken token);

}
